package com.hdl.school.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegExp {
    private  Pattern pattern;
    public RegExp(String expStr) {
        pattern = Pattern.compile(expStr);
    }

    public boolean test(String str){
        if(pattern!=null){
            Matcher matcher = pattern.matcher(str);
            return matcher.find();
        }
        return false;
    }
}
